// eslint - disable - next - line
import {
  UserLayout,
  BasicLayout,
  PageView
} from '@/layouts'

export const asyncRouterMap = [

  {
    path: '/',
    name: 'index',
    component: BasicLayout,
    meta: {
      title: '首页'
    },
    redirect: '/enterprise/list',
    children: [

      {
        path: '/enterprise',
        name: 'Enterprise',
        component: PageView,
        redirect: '/enterprise/list',
        meta: {
          title: '企业管理',
          icon: 'shop',
          permission: ['table']
        },
        children: [{
          path: '/enterprise/list/:pageNumber([1-9]\\d*)?',
          name: 'EnterpriseList',
          hideChildrenInMenu: true, // 强制显示 MenuItem 而不是 SubMenu
          component: () => import('@/views/enterprise/list'),
          meta: {
            title: '企业列表',
            keepAlive: true,
            permission: ['table']
          }
        },
        {
          path: '/enterprise/edit/:enterpriseId',
          name: 'EnterpriseEdit',
          hideChildrenInMenu: true,
          hidden: true,
          component: () => import('@/views/enterprise/add'),
          meta: {
            title: '编辑企业',
            keepAlive: true,
            permission: ['table']
          }
        },
        {
          path: '/enterprise/add/:pageNumber([1-9]\\d*)?',
          name: 'EnterpriseAdd',
          hideChildrenInMenu: true,
          component: () => import('@/views/enterprise/add'),
          meta: {
            title: '新增企业',
            keepAlive: true,
            permission: ['table']
          }
        }
        ]
      },

      // {
      //   path: '/user',
      //   name: 'User',
      //   component: PageView,
      //   redirect: '/user/list',
      //   meta: {
      //     title: '用户管理',
      //     icon: 'team',
      //     permission: ['table']
      //   },
      //   children: [{
      //     path: '/user/list/:pageNumber([1-9]\\d*)?',
      //     name: 'UserList',
      //     hideChildrenInMenu: true,
      //     component: () => import('@/views/user/list'),
      //     meta: {
      //       title: '用户列表',
      //       keepAlive: true,
      //       permission: ['table']
      //     }
      //   }]
      // },
      // {
      //   path: '/project',
      //   name: 'Project',
      //   component: PageView,
      //   redirect: '/project/list',
      //   meta: {
      //     title: '众包管理',
      //     icon: 'build',
      //     permission: ['table']
      //   },
      //   children: [{
      //     path: '/project/list/:pageNumber([1-9]\\d*)?',
      //     name: 'ProjectList',
      //     hideChildrenInMenu: true,
      //     component: () => import('@/views/project/list'),
      //     meta: {
      //       title: '项目列表',
      //       keepAlive: true,
      //       permission: ['table']
      //     }
      //   },
      //   {
      //     path: '/project/category',
      //     name: 'ProjectCategory',
      //     hideChildrenInMenu: true,
      //     component: () => import('@/views/project/category'),
      //     meta: {
      //       title: '项目分类',
      //       keepAlive: true,
      //       permission: ['table']
      //     }
      //   },
      //   {
      //     path: '/project/skill',
      //     name: 'ProjectSkill',
      //     hideChildrenInMenu: true,
      //     component: () => import('@/views/project/skill'),
      //     meta: {
      //       title: '技能管理',
      //       keepAlive: true,
      //       permission: ['table']
      //     }
      //   },
      //   {
      //     path: '/project/detail/:projectId',
      //     name: 'ProjectDetail',
      //     hideChildrenInMenu: true,
      //     hidden: true,
      //     component: () => import('@/views/project/detail'),
      //     meta: {
      //       title: '项目详情',
      //       keepAlive: true,
      //       permission: ['table']
      //     }
      //   }
      //   ]
      // },

      {
        path: '/financial',
        name: 'Financial',
        component: PageView,
        redirect: '/financial/payment',
        meta: {
          title: '财务管理',
          icon: 'account-book',
          permission: ['table']
        },
        children: [{
          path: '/financial/payment',
          name: 'FinancialPayment',
          hideChildrenInMenu: true,
          component: () => import('@/views/financial/payment'),
          meta: {
            title: '结算支付列表',
            keepAlive: true,
            permission: ['table']
          }
        },
        {
          path: '/financial/bill',
          name: 'FinancialBill',
          hideChildrenInMenu: true,
          component: () => import('@/views/financial/bill'),
          meta: {
            title: '账单列表',
            keepAlive: true,
            permission: ['table']
          }
        },
        {
          path: '/financial/settlement',
          name: 'FinancialSettlement',
          hideChildrenInMenu: true,
          component: () => import('@/views/financial/settlement'),
          meta: {
            title: '异常结算订单',
            keepAlive: true,
            permission: ['table']
          }
        }
        ]
      },
      // {
      //   path: '/business',
      //   name: 'Business',
      //   redirect: '/business/list',
      //   component: PageView,
      //   meta: { title: '业务监察',  icon: 'account-book', permission: ['table'] },
      //   children: [{
      //     path: '/business/list',
      //     name: 'Bill',
      //     hideChildrenInMenu: true,
      //     component: () => import('@/views//business/list'),
      //     meta: {
      //       title: '项目列表',
      //       keepAlive: true,
      //       permission: ['table'],
      //     }
      //   },
      //   {
      //     path: '/business/detail/:projectId',
      //     name: 'BusinessDetail',
      //     hideChildrenInMenu: true,
      //     hidden: true,
      //     component: () => import('@/views/business/detail'),
      //     meta: {
      //       title: '项目详情',
      //       keepAlive: true,
      //       permission: ['table']
      //     }
      //   }
      // ]
      // },
      // {
      //   path: '/system',
      //   name: 'System',
      //   component: PageView,
      //   redirect: '/system/banner',
      //   meta: {
      //     title: '系统管理',
      //     icon: 'setting',
      //     permission: ['table']
      //   },
      //   children: [{
      //     path: '/system/banner',
      //     name: 'SystemBanner',
      //     hideChildrenInMenu: true,
      //     component: () => import('@/views/system/banner'),
      //     meta: {
      //       title: '横幅配置',
      //       keepAlive: true,
      //       permission: ['table']
      //     }
      //   }]
      // },
      // {
      //   path: '/bill',
      //   name: 'Bill',
      //   redirect: '/bill/administration',
      //   component: PageView,
      //   meta: { title: '发票管理',  icon: 'account-book', permission: ['table'] },
      //   children: [{
      //     path: '/bill/administration',
      //     name: 'Bill',
      //     hideChildrenInMenu: true,
      //     component: () => import('@/views/bill/administration'),
      //     meta: {
      //       title: '发票管理',
      //       keepAlive: true,
      //       permission: ['table'],
      //     }
      //   }]
      // },
      {
        path: '/agent',
        name: 'Agent',
        component: PageView,
        redirect: '/agent/list',
        meta: {
          title: '代理商管理',
          icon: 'user',
          permission: ['table']
        },
        children: [{
          path: '/agent/list',
          name: 'AccountInfo',
          hideChildrenInMenu: true,
          component: () => import('@/views/agent/list'),
          meta: {
            title: '代理商列表',
            keepAlive: true,
            permission: ['table']
          }
        }]
      },
      {
        path: '/datastatistics',
        name: 'Datastatistics',
        component: PageView,
        redirect: '/datastatistics/general',
        meta: {
          title: '数据统计',
          icon: 'area-chart',
          permission: ['数据统计']
        },
        children: [{
          path: '/datastatistics/general',
          name: 'DatastatisticsGeneral',
          hideChildrenInMenu: true,
          component: () => import('@/views/datastatistics/general'),
          meta: {
            title: '数据总览',
            keepAlive: true,
            permission: ['数据统计-数据总览']
          }
        }]
      }
      // {
      //   path: '/account',
      //   name: 'Account',
      //   component: PageView,
      //   redirect: '/account/info',
      //   meta: {
      //     title: '账户管理',
      //     icon: 'user',
      //     permission: ['table']
      //   },
      //   children: [{
      //     path: '/account/info',
      //     name: 'AccountInfo',
      //     hideChildrenInMenu: true,
      //     component: () => import('@/views/account/info'),
      //     meta: {
      //       title: '账户信息',
      //       keepAlive: true,
      //       permission: ['table']
      //     }
      //   }]
      // }
    ]
  },
  {
    path: '*',
    redirect: '/404',
    hidden: true
  }
]

/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [{
  path: '/login',
  component: UserLayout,
  redirect: '/login/index',
  hidden: true,
  children: [{
    path: 'index',
    name: 'login',
    component: () => import( /* webpackChunkName: "user" */ '@/views/login/Login')
  },
  // {
  //   path: 'register',
  //   name: 'register',
  //   component: () => import(/* webpackChunkName: "user" */ '@/views/login/Register')
  // },
  // {
  //   path: 'register-result',
  //   name: 'registerResult',
  //   component: () => import(/* webpackChunkName: "user" */ '@/views/login/RegisterResult')
  // },
  {
    path: 'recover',
    name: 'recover',
    component: undefined
  }
  ]
},

{
  path: '/404',
  component: () => import( /* webpackChunkName: "fail" */ '@/views/exception/404')
}

]